﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Collections ;

namespace XDesigner.AppFramework
{
    public interface IAppUserProvider
    {
        /// <summary>
        /// 获得系统中所有的用户信息对象
        /// </summary>
        /// <returns></returns>
        IList GetUsers();
        /// <summary>
        /// 获得指定名称的系统用户对象
        /// </summary>
        /// <param name="name">用户登录名</param>
        /// <returns></returns>
        IAppUser GetUser(string name);
        /// <summary>
        /// 验证系统用户
        /// </summary>
        /// <param name="name">用户登录名</param>
        /// <param name="password">用户输入的原始密码</param>
        /// <returns>若验证通过则返回用户对象，否则返回空引用</returns>
        IAppUser Validate(string name, string password);
        /// <summary>
        /// 修改用户登录密码
        /// </summary>
        /// <param name="name">用户名</param>
        /// <param name="newPassword">新密码</param>
        /// <returns>操作是否成功</returns>
        bool ChangePassword(string name, string newPassword);
    }

    /// <summary>
    /// 系统用户对象
    /// </summary>
    public interface IAppUser
    {
        /// <summary>
        /// 用户编号
        /// </summary>
        string ID { get;set;}
        /// <summary>
        /// 用户名
        /// </summary>
        string Name { get;set;}
    }
}
